<?php
namespace Popshouse\SiteBundle\Entity;


/**
 * @orm:Entity
 * @orm:Table(name="guestbook")
*/
class Entry{
	

	public function __construct() {
        $this->children = new \Doctrine\Common\Collections\ArrayCollection();
    }
    
	/**
     * @orm:Id
     * @orm:Column(name="id",type="integer")
     * @orm:GeneratedValue(strategy="AUTO")
     */
	protected $id;
	
	/**
     * @orm:Column(type="string")
     * @assert:NotBlank()
     */
	protected $name;

	/**
     * @orm:Column(type="string")
     */
	protected $place;
	
	/**
     * @orm:Column(type="string")
     * @assert:Email
     */
	protected $email;
	
	/**
     * @orm:Column(type="string")
     */
	protected $ip;
	
	/**
     * @orm:Column(type="text")
     * @assert:NotBlank()
     */
	protected $bericht;
	
	/**
     * @orm:Column(type="boolean")
     * @assert:AssertType("boolean")
     */
	protected $admin = false;
	
	/**
     * @orm:Column(type="integer")
     */
	protected $datum;
	
    /**
     * @orm:OneToMany(targetEntity="Entry", mappedBy="parent")
     */
    private $children;

    /**
     * @orm:ManyToOne(targetEntity="Entry", inversedBy="children")
     * @orm:JoinColumn(name="parentid", referencedColumnName="id")
     */
    private $parent;
    

    /**
	 * @return the $children
	 */
	public function getChildren() {
		return $this->children;
	}

	/**
	 * @return the $parent
	 */
	public function getParent() {
		return $this->parent;
	}

	/**
	 * @param field_type $parent
	 */
	public function setParent($parent) {
		$this->parent = $parent;
		$parent->getChildren()->add($this);
	}


    
	/**
	 * @return the $id
	 */
	public function getId() {
		return $this->id;
	}

	/**
	 * @return the $name
	 */
	public function getName() {
		return $this->name;
	}

	/**
	 * @return the $place
	 */
	public function getPlace() {
		return $this->place;
	}

	/**
	 * @return the $email
	 */
	public function getEmail() {
		return $this->email;
	}

	/**
	 * @return the $ip
	 */
	public function getIp() {
		return $this->ip;
	}

	/**
	 * @return the $bericht
	 */
	public function getBericht() {
		return $this->bericht;
	}

	/**
	 * @return the $admin
	 */
	public function getAdmin() {
		return $this->admin;
	}

	/**
	 * @return the $datum
	 */
	public function getDatum() {
		return $this->datum;
	}

	/**
	 * @return the $commentid
	 */
	public function getCommentid() {
		return $this->commentid;
	}

	/**
	 * @param field_type $name
	 */
	public function setName($name) {
		$this->name = $name;
	}

	/**
	 * @param field_type $place
	 */
	public function setPlace($place) {
		$this->place = $place;
	}

	/**
	 * @param field_type $email
	 */
	public function setEmail($email) {
		$this->email = $email;
	}

	/**
	 * @param field_type $ip
	 */
	public function setIp($ip) {
		$this->ip = $ip;
	}

	/**
	 * @param field_type $bericht
	 */
	public function setBericht($bericht) {
		$this->bericht = $bericht;
	}

	/**
	 * @param field_type $admin
	 */
	public function setAdmin($admin) {
		$this->admin = $admin;
	}

	/**
	 * @param field_type $datum
	 */
	public function setDatum($datum) {
		$this->datum = $datum;
	}



}
 
